<template>
  <el-menu mode="horizontal" :router="true" :default-active="nowPath">
    <el-menu-item key="/home/tabs/star" index="/home/tabs/star">
      开启服务
    </el-menu-item>
    <el-menu-item key="/home/tabs/initial" :disabled='next' index="/home/tabs/initial">
      初始化KDC
    </el-menu-item>
    <el-menu-item key="/home/tabs/center" :disabled='next1' index="/home/tabs/center">
      初始化中心
    </el-menu-item>
    <el-menu-item key="/home/tabs/send" :disabled='next2' index="/home/tabs/send">
      发卡
    </el-menu-item>
  </el-menu>
  <router-view></router-view>
 
</template>

<script>
import { useRoute } from "vue-router";
import { ref, watch,computed } from "vue";

import {mapState} from 'vuex'
export default {
    computed:{
     ...mapState(['next','next1','next2'])
  },
  setup() {
    const route = useRoute();
    let nowPath = ref("");
    
    watch(
      () => route.fullPath,
      () => {
        nowPath.value = route.fullPath;
      },
      { immediate: true }
    );
    return {
      nowPath
    };
  },
};
</script>

<style scoped lang='scss'>
  
</style>